import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import PlayListDetail from '../components/playListDetail/PlayListDetail.vue'
import RankListDetail from '../components/Rank/RankListDetail.vue'
import Player from '../components/player/Player.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home,
        meta:{
            showTab:true
        }  
    },
    
    {
        path: '/rank',
        name: 'Rank',
        component: () =>
            import ( /* webpackChunkName: "Rank" */ '../views/Rank.vue'),
        meta:{
            showTab:true
        }
    },
    {
        path: '/ranklistdetail/:id',
        name: 'RankListDetail',
        component: RankListDetail,
        meta:{
            showTab:false
        }    
    },
    {
        path:'/playlistdetail/:id',//动态路由
        name:'PlayListDetail',
        component:PlayListDetail,
        meta:{
            showTab:false
        }  
    },
    {
        path:'/player/:id',//动态路由
        name:'Player',
        component:Player,
        meta:{
            showTab:false
        }  
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router